/* Copyright (c) 2004-2024 Peigen.info. All rights reserved. */

package info.peigen.hotpot.component.gateway.mqtt.server.service;

import lombok.extern.slf4j.Slf4j;
import net.dreamlu.iot.mqtt.server.noear.MqttServerTemplate;
import org.noear.solon.annotation.Component;
import org.noear.solon.annotation.Inject;

/**
 * <b>(MqttServerManageService)</b>
 *
 * @author Peigen
 * @version 1.0.0
 * @since 2022/7/23
 */
@Slf4j
@Component
public class MqttServerManageService {
    @Inject
    private MqttServerTemplate server;

    /**
     * 服务端主动断开连接
     *
     * @param clientId 客户端Id
     */
    public void close(String clientId) {
        log.info("Mqtt-Server close,ClientId={}", clientId);
        server.close(clientId);
    }
}